<template>
    <div class="link-jump-prompt" v-if="visible" :class="{ 'dark-theme': isDarkMode }">
        <div class="link-jump-backdrop" @click="cancel"></div>
        <div class="link-jump-prompt-container">
            <!-- 霓虹边框效果 -->
            <div class="neon-border-container">
                <div class="neon-border neon-border-top"></div>
                <div class="neon-border neon-border-right"></div>
                <div class="neon-border neon-border-bottom"></div>
                <div class="neon-border neon-border-left"></div>
            </div>

            <!-- 头部 -->
            <div class="prompt-header">
                <div class="site-info">
                    <div class="logo-wrapper">
                        <div class="logo-glow"></div>
                        <img :src="logo" alt="网站logo" class="site-logo">
                    </div>
                    <span class="site-name">{{ siteName }}</span>
                </div>
                <div class="prompt-badge">
                    <i class="el-icon-info"></i> 外部链接
                </div>
                <div class="close-btn" @click="cancel">
                    <i class="el-icon-close"></i>
                </div>
            </div>

            <!-- 内容区 -->
            <div class="prompt-content">
                <div class="prompt-icon">
                    <i class="el-icon-link"></i>
                    <div class="icon-pulse"></div>
                </div>
                <div class="prompt-message">
                    <h3>您即将离开本站</h3>
                    <p>您点击的链接将带您前往：</p>
                    <div class="target-url">
                        <div class="url-content">{{ currentUrl || url }}</div>
                        <div class="url-actions">
                            <button class="url-action-btn copy-btn" @click.stop="copyUrl" title="复制链接"
                                :class="{ success: copySuccess }">
                                <i :class="copySuccess ? 'el-icon-check' : 'el-icon-document-copy'"></i>
                                <span class="tooltip">{{ copySuccess ? '已复制' : '复制链接' }}</span>
                            </button>
                        </div>
                    </div>
                    <div class="safety-info">
                        <i class="el-icon-warning"></i>
                        <span>请注意，我们无法保证外部网站的安全性和内容</span>
                    </div>
                    <div class="url-info">
                        <div class="url-detail" v-if="urlDomain">
                            <span class="url-label">域名：</span>
                            <span class="url-value">{{ urlDomain }}</span>
                            <span class="domain-icon"><i class="el-icon-position"></i></span>
                        </div>
                        <div class="security-badges">
                            <div class="security-badge">
                                <i class="el-icon-warning-outline"></i>
                                <span>谨慎访问</span>
                            </div>
                            <div class="security-badge">
                                <i class="el-icon-connection"></i>
                                <span>外部链接</span>
                            </div>
                        </div>
                    </div>
                    <p class="countdown-msg">
                        <span class="countdown-label">自动跳转倒计时：</span>
                        <span class="countdown">{{ countdown }}</span>
                        <span class="countdown-ring"></span>
                    </p>
                </div>
            </div>

            <!-- 按钮区 -->
            <div class="prompt-actions">
                <el-button @click="cancel" plain class="cancel-btn">
                    <i class="el-icon-close"></i> 取消
                </el-button>
                <el-button type="primary" @click="confirmJump" class="confirm-btn">
                    <i class="el-icon-right"></i> 立即前往
                    <span class="btn-effect"></span>
                </el-button>
            </div>

            <!-- 动画元素 -->
            <div class="animated-elements">
                <div class="floating-shape shape-circle"></div>
                <div class="floating-shape shape-triangle"></div>
                <div class="floating-shape shape-square"></div>
                <div class="floating-shape shape-plus"></div>
                <div class="floating-shape shape-hexagon"></div>
                <div class="floating-shape shape-star"></div>
                <div class="light-spot light-spot-1"></div>
                <div class="light-spot light-spot-2"></div>
                <div class="light-spot light-spot-3"></div>
                <div class="particle particle-1"></div>
                <div class="particle particle-2"></div>
                <div class="particle particle-3"></div>
                <div class="particle particle-4"></div>
                <div class="particle particle-5"></div>
                <div class="ripple-effect ripple-1"></div>
                <div class="ripple-effect ripple-2"></div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name: 'LinkJumpPrompt',
    props: {
        url: {
            type: String,
            default: ''
        },
        siteName: {
            type: String,
            default: 'KingCola-ICG Blog'
        },
        logo: {
            type: String,
            default: '/favicon.ico' // 默认使用网站favicon
        },
        autoJumpDelay: {
            type: Number,
            default: 10 // 默认10秒后自动跳转
        }
    },
    data() {
        return {
            visible: false,
            countdown: 10,
            timer: null,
            currentUrl: '',  // 存储当前要跳转的URL
            copySuccess: false,
            urlInfo: null
        }
    },
    computed: {
        urlDomain() {
            if (!this.currentUrl) return '';
            try {
                const url = new URL(this.currentUrl);
                return url.hostname;
            } catch (e) {
                return '';
            }
        },
        isDarkMode() {
            // 从vuex获取当前主题模式
            return this.$store && this.$store.state.darkMode;
        }
    },
    watch: {
        autoJumpDelay: {
            immediate: true,
            handler(val) {
                this.countdown = val;
            }
        }
    },
    methods: {
        // 显示提示框
        show(url) {
            // 如果提供了URL参数，使用它；否则使用prop中的url
            if (url) {
                this.currentUrl = url;
            } else if (this.url) {
                this.currentUrl = this.url;
            }

            // 如果没有URL，不显示
            if (!this.currentUrl) {
                console.error('链接跳转提示框：没有提供URL');
                return;
            }

            console.log('显示链接跳转提示框，URL:', this.currentUrl);
            this.visible = true;
            this.startCountdown();
            this.copySuccess = false;

            // 阻止滚动
            document.body.style.overflow = 'hidden';
        },

        // 隐藏提示框
        hide() {
            this.visible = false;
            this.stopCountdown();

            // 恢复滚动
            document.body.style.overflow = '';
        },

        // 开始倒计时
        startCountdown() {
            this.countdown = this.autoJumpDelay;
            this.stopCountdown(); // 清除可能存在的旧计时器

            this.timer = setInterval(() => {
                this.countdown--;
                if (this.countdown <= 0) {
                    this.jump();
                }
            }, 1000);
        },

        // 停止倒计时
        stopCountdown() {
            if (this.timer) {
                clearInterval(this.timer);
                this.timer = null;
            }
        },

        // 确认跳转
        confirmJump() {
            this.jump();
        },

        // 执行跳转
        jump() {
            this.stopCountdown();
            this.hide();

            // 使用实际要跳转的URL
            const targetUrl = this.currentUrl || this.url;
            if (targetUrl) {
                // 在新标签页中打开链接
                console.log('跳转到URL:', targetUrl);
                window.open(targetUrl, '_blank', 'noopener,noreferrer');
            } else {
                console.error('链接跳转提示框：没有URL可跳转');
            }
        },

        // 取消跳转
        cancel() {
            this.hide();
            this.$emit('cancel');
        },

        // 复制链接
        copyUrl() {
            const url = this.currentUrl || this.url;
            if (!url) return;

            try {
                navigator.clipboard.writeText(url).then(() => {
                    this.copySuccess = true;
                    this.$message.success('链接已复制到剪贴板');
                    setTimeout(() => {
                        this.copySuccess = false;
                    }, 2000);
                }).catch(err => {
                    console.error('复制失败:', err);
                    this.$message.error('复制失败，请手动复制');
                });
            } catch (err) {
                console.error('复制失败:', err);
                this.$message.error('复制失败，请手动复制');
            }
        }
    },
    beforeDestroy() {
        // 清理计时器
        this.stopCountdown();
    }
}
</script>

<style lang="scss" scoped>
.link-jump-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.link-jump-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
}

.link-jump-prompt-container {
    position: relative;
    width: 90%;
    max-width: 550px;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(64, 158, 255, 0.1);
    overflow: hidden;
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateY(0);
    transition: transform 0.3s ease;
    z-index: 1;
}

/* 霓虹边框效果 */
.neon-border-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
    border-radius: 20px;
}

.neon-border {
    position: absolute;
    background: linear-gradient(90deg,
            rgba(64, 158, 255, 0),
            rgba(64, 158, 255, 0.8),
            rgba(64, 105, 255, 0.8),
            rgba(103, 58, 183, 0.8),
            rgba(64, 158, 255, 0));
    filter: blur(1px);
}

.neon-border-top {
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    animation: neonBorderFlow 4s infinite linear;
}

.neon-border-bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    animation: neonBorderFlow 4s infinite linear reverse;
}

.neon-border-left {
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    animation: neonBorderVerticalFlow 8s infinite linear;
    transform-origin: top;
    opacity: 0;
}

.neon-border-right {
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    animation: neonBorderVerticalFlow 8s infinite linear 2s;
    transform-origin: bottom;
    opacity: 0;
}

@keyframes neonBorderFlow {
    0% {
        background-position: 0% 50%;
        opacity: 0;
    }

    25% {
        opacity: 1;
    }

    75% {
        opacity: 1;
    }

    100% {
        background-position: 200% 50%;
        opacity: 0;
    }
}

@keyframes neonBorderVerticalFlow {
    0% {
        height: 0%;
        opacity: 0;
    }

    25% {
        height: 100%;
        opacity: 1;
    }

    50% {
        height: 100%;
        opacity: 1;
    }

    75% {
        height: 100%;
        opacity: 0.5;
    }

    100% {
        height: 0%;
        opacity: 0;
    }
}

.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #ebeef5;
    background: linear-gradient(135deg, #f8f9fa, #f2f3f5);
    position: relative;
    overflow: hidden;
}

.prompt-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(64, 158, 255, 0) 0%,
            rgba(64, 158, 255, 0.05) 50%,
            rgba(64, 158, 255, 0) 100%);
    animation: headerShine 3s infinite linear;
    pointer-events: none;
}

@keyframes headerShine {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

.site-info {
    display: flex;
    align-items: center;
}

.logo-wrapper {
    position: relative;
    margin-right: 14px;
}

.logo-glow {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: radial-gradient(circle at 50% 50%, rgba(64, 158, 255, 0.5), transparent 70%);
    border-radius: 50%;
    animation: logoGlowPulse 3s infinite ease-in-out;
    opacity: 0.6;
    filter: blur(8px);
    z-index: -1;
}

@keyframes logoGlowPulse {
    0% {
        opacity: 0.4;
        filter: blur(8px);
    }

    50% {
        opacity: 0.7;
        filter: blur(10px);
    }

    100% {
        opacity: 0.4;
        filter: blur(8px);
    }
}

.site-logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(135deg, #409EFF, #4069FF) border-box;
}

.site-info:hover .site-logo {
    transform: rotate(15deg) scale(1.15);
    box-shadow: 0 6px 15px rgba(64, 158, 255, 0.3);
    animation: logoWobble 3s infinite ease-in-out;
}

@keyframes logoWobble {
    0% {
        transform: rotate(15deg) scale(1.15);
    }

    25% {
        transform: rotate(10deg) scale(1.18);
    }

    50% {
        transform: rotate(0deg) scale(1.15);
    }

    75% {
        transform: rotate(-10deg) scale(1.12);
    }

    100% {
        transform: rotate(15deg) scale(1.15);
    }
}

.site-name {
    font-weight: 600;
    font-size: 18px;
    color: #303133;
    background: linear-gradient(135deg, #409EFF, #4069FF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 5px rgba(64, 158, 255, 0.1);
    letter-spacing: -0.3px;
    position: relative;
}

.site-name::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #409EFF, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.site-info:hover .site-name::after {
    opacity: 1;
}

.prompt-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(64, 158, 255, 0.15), rgba(64, 105, 255, 0.1));
    color: #409EFF;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(64, 158, 255, 0.2);
    box-shadow: 0 2px 8px rgba(64, 158, 255, 0.1);
}

.prompt-badge i {
    font-size: 14px;
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background-color: rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle at center, rgba(0, 0, 0, 0.1), transparent 70%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    &:hover {
        background-color: rgba(0, 0, 0, 0.08);
        transform: rotate(90deg) scale(1.1);

        &::before {
            opacity: 1;
            animation: ripple 0.6s ease-out;
        }
    }

    i {
        font-size: 20px;
        color: #909399;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0.3);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.prompt-content {
    padding: 34px 28px;
    display: flex;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

.prompt-icon {
    position: relative;
    background: linear-gradient(135deg, #409EFF, #4069FF);
    width: 68px;
    height: 68px;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 25px;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(64, 158, 255, 0.25);
    transform: rotate(0);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;

    &::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: conic-gradient(transparent,
                rgba(255, 255, 255, 0.3),
                transparent 30%);
        animation: rotateGradient 4s linear infinite;
    }

    &:hover {
        transform: rotate(10deg) translateY(-5px);
        box-shadow: 0 12px 25px rgba(64, 158, 255, 0.3);

        i {
            animation: iconFloat 2s infinite ease-in-out;
        }
    }

    i {
        font-size: 32px;
        color: #ffffff;
        position: relative;
        z-index: 2;
        filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
        transition: all 0.3s ease;
    }

    .icon-pulse {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        height: 100%;
        border-radius: 20px;
        background: rgba(64, 158, 255, 0.8);
        z-index: 1;
        animation: iconPulse 2s infinite;
    }
}

@keyframes rotateGradient {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes iconFloat {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes iconPulse {
    0% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.8);
    }

    50% {
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(1.2);
    }

    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

.prompt-message {
    flex: 1;

    h3 {
        margin: 0 0 14px;
        font-size: 24px;
        color: #303133;
        font-weight: 700;
        position: relative;
        display: inline-block;
        letter-spacing: -0.5px;
        background: linear-gradient(135deg, #303133, #606266);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        text-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    h3::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 0;
        width: 100%;
        height: 3px;
        background: linear-gradient(90deg, #409EFF, #4069FF, transparent);
        border-radius: 3px;
        box-shadow: 0 1px 3px rgba(64, 158, 255, 0.2);
    }

    p {
        margin: 14px 0;
        color: #606266;
        font-size: 16px;
        line-height: 1.6;
        font-weight: 500;
    }

    .target-url {
        position: relative;
        background-color: #f5f7fa;
        padding: 18px;
        border-radius: 14px;
        margin: 16px 0;
        word-break: break-all;
        font-family: monospace;
        color: #303133;
        border-left: 4px solid #409EFF;
        max-height: 100px;
        overflow-y: auto;
        transition: all 0.3s ease;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        position: relative;
        overflow: hidden;

        &::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg,
                    rgba(64, 158, 255, 0.03) 0%,
                    rgba(64, 158, 255, 0) 40%);
            pointer-events: none;
        }

        &::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 5px;
            height: 100%;
            background: linear-gradient(to bottom, #409EFF, #4069FF, #409EFF);
            animation: borderPulse 3s infinite;
        }

        &:hover {
            background-color: #eef2f8;
            border-left-color: #4069FF;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
            transform: translateY(-2px);
        }

        .url-content {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            position: relative;
            padding-left: 5px;

            &::before {
                content: '🔗';
                margin-right: 8px;
                opacity: 0.7;
            }
        }

        .url-actions {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-left: 14px;
            flex-shrink: 0;
        }

        .url-action-btn {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            background: rgba(64, 158, 255, 0.1);
            border: none;
            color: #409EFF;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            position: relative;
            overflow: hidden;

            &::after {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: radial-gradient(circle at center, rgba(64, 158, 255, 0.2), transparent 70%);
                opacity: 0;
                transition: opacity 0.3s ease;
            }

            .tooltip {
                position: absolute;
                bottom: -30px;
                left: 50%;
                transform: translateX(-50%);
                background: rgba(64, 158, 255, 0.9);
                color: white;
                padding: 5px 10px;
                border-radius: 6px;
                font-size: 12px;
                white-space: nowrap;
                opacity: 0;
                visibility: hidden;
                transition: all 0.3s ease;
                font-family: sans-serif;
                pointer-events: none;
                box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            }

            &:hover {
                background: rgba(64, 158, 255, 0.2);
                transform: translateY(-3px) scale(1.1);
                box-shadow: 0 5px 10px rgba(64, 158, 255, 0.15);

                &::after {
                    opacity: 1;
                    animation: buttonRipple 0.8s ease-out;
                }

                .tooltip {
                    opacity: 1;
                    visibility: visible;
                    transform: translateX(-50%) translateY(0);
                }
            }

            &:active {
                transform: translateY(0) scale(0.95);
                box-shadow: none;
            }

            &.success {
                background: rgba(82, 196, 26, 0.2);
                color: #52c41a;
            }
        }
    }

    .safety-info {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        margin: 18px 0;
        background-color: rgba(255, 226, 183, 0.3);
        border-left: 4px solid #e6a23c;
        padding: 14px 16px;
        border-radius: 12px;
        font-size: 14px;
        animation: fadeInUp 0.6s ease-out forwards;
        animation-delay: 0.3s;
        opacity: 0;
        transform: translateY(10px);
        box-shadow: 0 4px 12px rgba(230, 162, 60, 0.12);
        position: relative;
        overflow: hidden;

        &::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle at 10% 0%, rgba(230, 162, 60, 0.08), transparent 70%);
            pointer-events: none;
        }

        i {
            color: #e6a23c;
            font-size: 20px;
            margin-top: 1px;
            filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
            background: rgba(230, 162, 60, 0.15);
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            flex-shrink: 0;
        }

        span {
            color: #8c6c3d;
            line-height: 1.6;
            font-weight: 500;
        }
    }

    .url-info {
        margin: 16px 0;
        font-size: 14px;
        color: #606266;

        .url-detail {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
            background-color: rgba(64, 158, 255, 0.05);
            padding: 12px 16px;
            border-radius: 12px;
            animation: fadeInUp 0.6s ease-out forwards;
            animation-delay: 0.4s;
            opacity: 0;
            transform: translateY(10px);
            box-shadow: 0 3px 8px rgba(64, 158, 255, 0.08);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;

            &::after {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: linear-gradient(135deg,
                        rgba(64, 158, 255, 0.03) 0%,
                        rgba(64, 158, 255, 0) 50%);
                pointer-events: none;
            }

            &:hover {
                background-color: rgba(64, 158, 255, 0.1);
                box-shadow: 0 5px 15px rgba(64, 158, 255, 0.12);
                transform: translateY(-2px);
            }

            .url-label {
                color: #909399;
                margin-right: 10px;
                white-space: nowrap;
                font-weight: 600;
            }

            .url-value {
                color: #409EFF;
                font-weight: 600;
                word-break: break-all;
                flex: 1;
            }

            .domain-icon {
                margin-left: 10px;
                width: 28px;
                height: 28px;
                display: flex;
                align-items: center;
                justify-content: center;
                background: rgba(64, 158, 255, 0.1);
                border-radius: 50%;
                color: #409EFF;
                flex-shrink: 0;
                transition: all 0.3s ease;

                &:hover {
                    background: rgba(64, 158, 255, 0.2);
                    transform: scale(1.1);
                }
            }
        }

        .security-badges {
            display: flex;
            gap: 10px;
            margin-top: 12px;
            animation: fadeInUp 0.6s ease-out forwards;
            animation-delay: 0.5s;
            opacity: 0;
            transform: translateY(10px);
            flex-wrap: wrap;
        }

        .security-badge {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 12px;
            border-radius: 20px;
            background: rgba(64, 158, 255, 0.05);
            color: #409EFF;
            font-size: 12px;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: 0 2px 5px rgba(64, 158, 255, 0.05);

            &:hover {
                background: rgba(64, 158, 255, 0.1);
                transform: translateY(-2px);
                box-shadow: 0 4px 10px rgba(64, 158, 255, 0.1);
            }

            &:first-child {
                background: rgba(230, 162, 60, 0.1);
                color: #e6a23c;

                &:hover {
                    background: rgba(230, 162, 60, 0.15);
                    box-shadow: 0 4px 10px rgba(230, 162, 60, 0.1);
                }
            }

            i {
                font-size: 14px;
            }
        }
    }

    .countdown-msg {
        font-size: 15px;
        color: #909399;
        margin-top: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        animation: fadeInUp 0.6s ease-out forwards;
        animation-delay: 0.6s;
        opacity: 0;
        transform: translateY(10px);
        position: relative;

        .countdown-label {
            margin-right: 5px;
            font-weight: 500;
        }

        .countdown {
            font-weight: 700;
            color: #F56C6C;
            font-size: 24px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            text-align: center;
            margin: 0 5px;
            animation: pulse 1s infinite;
            text-shadow: 0 0 8px rgba(245, 108, 108, 0.4);
            position: relative;
            z-index: 1;
            background: rgba(245, 108, 108, 0.1);
            border-radius: 50%;
            box-shadow: 0 0 0 2px rgba(245, 108, 108, 0.2);
            transform: scale(1);
            transition: all 0.3s ease;

            &::before {
                content: '';
                position: absolute;
                top: -4px;
                left: -4px;
                right: -4px;
                bottom: -4px;
                border-radius: 50%;
                border: 2px solid rgba(245, 108, 108, 0.3);
                animation: countdown-ring 1s infinite;
                opacity: 0.7;
            }
        }

        .countdown-ring {
            position: absolute;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: 2px solid rgba(245, 108, 108, 0.3);
            animation: ringPulse 1s infinite;
            z-index: 0;
        }
    }
}

@keyframes countdown-ring {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.3;
    }

    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

.prompt-actions {
    padding: 24px 28px;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    border-top: 1px solid #ebeef5;
    background-color: #f8f9fa;
    position: relative;
    overflow: hidden;

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 2px;
        background: linear-gradient(90deg,
                rgba(64, 158, 255, 0),
                rgba(64, 158, 255, 0.5),
                rgba(64, 158, 255, 0));
        animation: borderGlow 2s infinite linear;
    }

    .el-button {
        padding: 12px 24px;
        font-size: 15px;
        border-radius: 12px;
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        position: relative;
        overflow: hidden;

        i {
            margin-right: 6px;
            transition: all 0.3s ease;
        }

        &:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);

            i {
                transform: translateX(-3px) scale(1.2);
            }
        }

        &:active {
            transform: translateY(0);
        }
    }

    .cancel-btn {
        position: relative;
        overflow: hidden;

        &::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg,
                    rgba(0, 0, 0, 0) 0%,
                    rgba(0, 0, 0, 0.05) 50%,
                    rgba(0, 0, 0, 0) 100%);
            transform: translateX(-100%);
            transition: transform 0.5s ease;
        }

        &:hover {
            color: #F56C6C;
            border-color: rgba(245, 108, 108, 0.3);
            background-color: rgba(245, 108, 108, 0.05);

            &::after {
                transform: translateX(100%);
            }
        }
    }

    .confirm-btn {
        background: linear-gradient(135deg, #409EFF, #4069FF);
        border-color: transparent;
        position: relative;
        box-shadow: 0 8px 15px rgba(64, 158, 255, 0.25);

        .btn-effect {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg,
                    rgba(255, 255, 255, 0) 0%,
                    rgba(255, 255, 255, 0.2) 50%,
                    rgba(255, 255, 255, 0) 100%);
            opacity: 0;
            transition: opacity 0.3s ease;
            transform: skewX(-20deg);
            pointer-events: none;
        }

        &:hover {
            background: linear-gradient(135deg, #4069FF, #3a56e5);
            box-shadow: 0 12px 25px rgba(64, 158, 255, 0.35);

            .btn-effect {
                opacity: 1;
                animation: buttonShine 1.5s infinite;
            }

            i {
                animation: arrowRight 1s infinite;
            }
        }
    }
}

@keyframes arrowRight {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(5px);
    }
}

@keyframes buttonShine {
    0% {
        left: -100%;
        opacity: 0.7;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

@keyframes borderGlow {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* 动画元素 */
.animated-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.floating-shape {
    position: absolute;
    opacity: 0.15;
    filter: blur(1px);
    pointer-events: none;
}

.shape-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #409EFF;
    top: 15%;
    right: 8%;
    animation: floatingAnimation 8s ease-in-out infinite;
}

.shape-triangle {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 22px solid #e6a23c;
    top: 75%;
    left: 6%;
    animation: floatingAnimation 10s ease-in-out infinite reverse;
}

.shape-square {
    width: 18px;
    height: 18px;
    background: #F56C6C;
    bottom: 12%;
    right: 7%;
    animation: floatingAnimation 12s ease-in-out infinite;
}

.shape-plus {
    width: 22px;
    height: 22px;
    top: 12%;
    left: 8%;
    animation: floatingAnimation 14s ease-in-out infinite reverse;
    position: relative;
}

.shape-plus::before,
.shape-plus::after {
    content: "";
    position: absolute;
    background: #67C23A;
}

.shape-plus::before {
    width: 100%;
    height: 4px;
    top: 50%;
    transform: translateY(-50%);
}

.shape-plus::after {
    width: 4px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.shape-hexagon {
    width: 20px;
    height: 12px;
    background: #909399;
    position: absolute;
    top: 40%;
    right: 20%;
    opacity: 0.15;
    animation: floatingAnimation 16s ease-in-out infinite;

    &:before,
    &:after {
        content: "";
        position: absolute;
        width: 0;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
    }

    &:before {
        bottom: 100%;
        border-bottom: 6px solid #909399;
    }

    &:after {
        top: 100%;
        border-top: 6px solid #909399;
    }
}

.shape-star {
    width: 0;
    height: 0;
    border-right: 10px solid transparent;
    border-bottom: 7px solid #F56C6C;
    border-left: 10px solid transparent;
    transform: rotate(35deg);
    position: absolute;
    bottom: 25%;
    left: 25%;
    opacity: 0.15;
    animation: floatingAnimation 14s ease-in-out infinite;

    &:before {
        border-bottom: 8px solid #F56C6C;
        border-left: 3px solid transparent;
        border-right: 3px solid transparent;
        position: absolute;
        height: 0;
        width: 0;
        top: -4px;
        left: -6px;
        display: block;
        content: '';
        transform: rotate(-35deg);
    }

    &:after {
        position: absolute;
        display: block;
        color: #F56C6C;
        top: 0px;
        left: -10px;
        width: 0px;
        height: 0px;
        border-right: 10px solid transparent;
        border-bottom: 7px solid #F56C6C;
        border-left: 10px solid transparent;
        transform: rotate(-70deg);
        content: '';
    }
}

/* 光点效果 */
.light-spot {
    position: absolute;
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.15;
    animation: spotPulse 8s infinite ease-in-out;
    pointer-events: none;
    z-index: 0;
}

.light-spot-1 {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at center, rgba(64, 158, 255, 0.8) 0%, transparent 70%);
    top: 20%;
    right: 25%;
    animation-delay: 0s;
}

.light-spot-2 {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at center, rgba(230, 162, 60, 0.7) 0%, transparent 75%);
    bottom: 15%;
    left: 20%;
    animation-delay: 3s;
}

@keyframes spotPulse {
    0% {
        opacity: 0.1;
        transform: scale(0.8);
    }

    50% {
        opacity: 0.2;
        transform: scale(1.2);
    }

    100% {
        opacity: 0.1;
        transform: scale(0.8);
    }
}

@keyframes floatingAnimation {

    0%,
    100% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(10px, -10px) rotate(5deg);
    }

    50% {
        transform: translate(0, -20px) rotate(-5deg);
    }

    75% {
        transform: translate(-10px, -10px) rotate(5deg);
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
        text-shadow: 0 0 8px rgba(245, 108, 108, 0.5);
    }

    100% {
        transform: scale(1);
    }
}

/* 响应式调整 */
@media screen and (max-width: 576px) {
    .link-jump-prompt-container {
        width: 95%;
        max-width: none;
    }

    .prompt-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px 18px;
    }

    .prompt-icon {
        margin-right: 0;
        margin-bottom: 20px;
    }

    .prompt-message {
        .target-url {
            font-size: 13px;
            padding: 12px;
            flex-direction: column;

            .url-actions {
                margin-left: 0;
                margin-top: 10px;
                justify-content: center;
            }
        }

        .safety-info {
            text-align: left;
        }

        .countdown-msg {
            justify-content: center;
        }
    }

    .prompt-actions {
        padding: 16px 18px;
    }
}

/* 全局动画定义 */
@keyframes ringPulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.3;
    }

    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

@keyframes buttonRipple {
    0% {
        transform: scale(0.5);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 添加微粒子动画 */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.4;
    z-index: 0;
}

.particle-1 {
    background: #409EFF;
    top: 20%;
    left: 10%;
    animation: particleFloat 15s infinite linear;
}

.particle-2 {
    background: #67C23A;
    bottom: 15%;
    right: 8%;
    width: 8px;
    height: 8px;
    animation: particleFloat 18s infinite linear reverse;
}

.particle-3 {
    background: #E6A23C;
    top: 60%;
    right: 15%;
    width: 5px;
    height: 5px;
    animation: particleFloat 12s infinite linear;
}

.particle-4 {
    background: #F56C6C;
    bottom: 30%;
    left: 15%;
    width: 7px;
    height: 7px;
    animation: particleFloat 20s infinite linear reverse;
}

.particle-5 {
    background: #909399;
    top: 40%;
    left: 5%;
    width: 4px;
    height: 4px;
    animation: particleFloat 13s infinite linear;
}

@keyframes particleFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(30px, -30px) rotate(90deg);
    }

    50% {
        transform: translate(0, -60px) rotate(180deg);
    }

    75% {
        transform: translate(-30px, -30px) rotate(270deg);
    }

    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* 添加涟漪效果 */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(64, 158, 255, 0.1);
    transform: scale(0);
    animation: rippleEffect 10s infinite;
    pointer-events: none;
}

.ripple-1 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -50px;
    animation-delay: 0s;
}

.ripple-2 {
    width: 150px;
    height: 150px;
    top: -30px;
    left: -30px;
    animation-delay: 5s;
    background: rgba(230, 162, 60, 0.1);
}

@keyframes rippleEffect {
    0% {
        transform: scale(0);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes buttonShine {
    0% {
        left: -100%;
        opacity: 0.7;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

/* 黑暗模式 */
.link-jump-prompt.dark-theme,
:root[data-theme='dark'] .link-jump-prompt {
    .link-jump-prompt-container {
        background-color: #1f2937;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .prompt-header {
        background: linear-gradient(135deg, #1a1e26, #151923);
        border-bottom-color: #374151;
    }

    .site-name {
        background: linear-gradient(135deg, #60a5fa, #818cf8);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .close-btn {
        background-color: rgba(255, 255, 255, 0.05);

        &:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }

        i {
            color: #d1d5db;
        }
    }

    .prompt-icon {
        background: linear-gradient(135deg, #3b82f6, #4f46e5);
        box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
    }

    .prompt-message {
        h3 {
            color: #f3f4f6;
            background: linear-gradient(135deg, #f3f4f6, #d1d5db);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        h3::after {
            background: linear-gradient(90deg, #3b82f6, transparent);
        }

        p {
            color: #d1d5db;
        }

        .target-url {
            background-color: #262f3f;
            color: #e5e7eb;
            border-left-color: #3b82f6;
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);

            &::before {
                background: linear-gradient(to bottom, #3b82f6, #4f46e5, #3b82f6);
            }

            &:hover {
                background-color: #2c3648;
                border-left-color: #60a5fa;
            }

            .url-action-btn {
                background: rgba(59, 130, 246, 0.2);
                color: #60a5fa;

                &:hover {
                    background: rgba(59, 130, 246, 0.3);
                }

                &.success {
                    background: rgba(34, 197, 94, 0.2);
                    color: #4ade80;
                }
            }
        }

        .safety-info {
            background-color: rgba(234, 179, 8, 0.1);
            border-left-color: #eab308;
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);

            i {
                color: #fbbf24;
            }

            span {
                color: #fcd34d;
            }
        }

        .url-info {
            color: #d1d5db;

            .url-detail {
                background-color: rgba(59, 130, 246, 0.1);
                box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);

                &:hover {
                    background-color: rgba(59, 130, 246, 0.15);
                }

                .url-label {
                    color: #9ca3af;
                }

                .url-value {
                    color: #60a5fa;
                }
            }
        }

        .countdown-msg {
            color: #9ca3af;

            .countdown {
                color: #f87171;
                text-shadow: 0 0 5px rgba(248, 113, 113, 0.4);
                background: rgba(248, 113, 113, 0.2);
                box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.3);
            }
        }
    }

    .prompt-actions {
        background-color: #151923;
        border-top-color: #374151;

        .el-button {
            border-color: #374151;
            color: #d1d5db;
            background-color: #1f2937;

            &:hover {
                border-color: #60a5fa;
                color: #f3f4f6;
                background-color: #263244;
            }
        }

        .el-button--primary {
            background: linear-gradient(135deg, #3b82f6, #4f46e5);
            border-color: transparent;
            color: #ffffff;

            &:hover {
                background: linear-gradient(135deg, #60a5fa, #818cf8);
                border-color: transparent;
            }
        }
    }

    /* 调整动画元素的颜色 */
    .shape-circle {
        background: #3b82f6;
    }

    .shape-triangle {
        border-bottom-color: #fbbf24;
    }

    .shape-square {
        background: #ef4444;
    }

    .shape-plus::before,
    .shape-plus::after {
        background: #10b981;
    }

    .shape-hexagon {
        background: #6b7280;

        &:before {
            border-bottom-color: #6b7280;
        }

        &:after {
            border-top-color: #6b7280;
        }
    }

    .shape-star {
        border-bottom-color: #ef4444;

        &:before,
        &:after {
            border-bottom-color: #ef4444;
        }
    }

    .light-spot-1 {
        background: radial-gradient(circle at center, rgba(59, 130, 246, 0.6) 0%, transparent 70%);
    }

    .light-spot-2 {
        background: radial-gradient(circle at center, rgba(251, 191, 36, 0.5) 0%, transparent 75%);
    }

    .particle-1 {
        background: #3b82f6;
    }

    .particle-2 {
        background: #10b981;
    }

    .particle-3 {
        background: #fbbf24;
    }

    .particle-4 {
        background: #ef4444;
    }

    .particle-5 {
        background: #6b7280;
    }

    .ripple-1 {
        background: rgba(59, 130, 246, 0.15);
    }

    .ripple-2 {
        background: rgba(251, 191, 36, 0.15);
    }
}

@keyframes borderPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}
</style>